﻿<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<head>
<title>APP版本</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../style/adminStyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
</head>
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="settings"></i><em>编辑版本</em></span>
  </div>
  <table class="noborder">
  
   <%--  <tr>
    <td style="text-align:right;"><b>id：</b></td>
    <td><input type="text" class="textBox length-long" id="id" value="${vson.id}" readonly="readonly"/></td>
   </tr> --%>
   
   <tr>
    <td style="width:15%;text-align:right;"><b>最新版本号（IOS更新）：</b></td>
    <td><input type="text" class="textBox length-long" id="versionName" value="${vson.versionName}"/></td>
   </tr>
   
   <tr>
    <td style="width:15%;text-align:right;"><b>IOS最低版本号：</b></td>
    <td><input type="text" class="textBox length-long" id="ios_minimum" value="${vson.ios_minimum}"/></td>
   </tr>
   
   <tr>
    <td style="width:15%;text-align:right;"><b>Android最低版本号：</b></td>
    <td><input type="text" class="textBox length-long" id="android_minimum" value="${vson.android_minimum}"/></td>
   </tr>
 
 
   <tr>
    <td style="text-align:right;"><b>下载地址：</b></td>
    <td><input type="text" class="textBox length-long" id="url" value="${vson.url}"/></td>
   </tr>
   
   <tr>
    <td style="text-align:right;"><b>更新次数（安卓更新）：</b></td>
    <td>
    <input type="text" class="textBox length-long" id="verstionCode" value="${vson.verstionCode}"/>  
    </td>
   </tr>
   
   <tr>
    <td style="text-align:right;"></td>
    <td><input type="button" value="修改" class="tdBtn" onclick="return addbasic(${vson.id})"/></td>
   </tr>
  </table>
 </div>
 <script type="text/javascript">
 
 function addbasic(id) {
		
	 	var versionName=$("#versionName").val();
	 	var ios_minimum=$("#ios_minimum").val();
		var android_minimum=$("#android_minimum").val();
		var url=$("#url").val();
		var verstionCode=$("#verstionCode").val();
		
		
	 var msg = "您确定要修改吗？\n\n请确认！";
			if(confirm(msg)==true){
				$.ajax({
					"url":"${pageContext.request.contextPath}/Administrators/vson_up.do",
					"data":{"id":id,"versionName":versionName,"ios_minimum":ios_minimum,"android_minimum":android_minimum,"url":url,"verstionCode":verstionCode},
					"type":"POST",
					"dataType":"json",
					"success":function(obj){

						if(obj.state==1){
							 alert("更新成功");
							window.location="${pageContext.request.contextPath}/Administrators/vson.do";
							
						}else{
							 alert("更新失败");
							
						}
				
					}});
				
			return true;
			}else{
			return false;
			}
			
		
		}
		
		
		
 

 </script>
</body>
</html>